﻿using System;

namespace Rmq.Center
{
    public class Msg<T>
    {
        /// <summary>
        /// 原始消息数据
        /// </summary>
        public T OrgMsg { get; set; }

        /// <summary>
        /// 消息Id
        /// </summary>
        public Guid MsgId { get; set; }

        /// <summary>
        /// 消息生产时间
        /// </summary>
        public DateTime MsgProduceDt { get; set; }

        /// <summary>
        /// 已处理次数
        /// </summary>
        public int ReceivedCount { get; set; }

        public Msg(T orgMsg)
        {
            this.OrgMsg = orgMsg;
            this.MsgId = Guid.NewGuid();
            this.MsgProduceDt = DateTime.Now;
            this.ReceivedCount = 0;
        }
    }
}